###*
 # @ngdoc function
 # @name xoceanApp.controller:ModuleNavCtrl
 # @description
 # # ModuleNavCtrl
 # 
###

angular.module('xoceanApp')
 .controller 'ModuleNavCtrl', ($scope)->
    # $scope.navs = [
    #   {
    #     name: '导航1'
    #     link: 'https://www.163.com'
    #   }
    #   {
    #     name: '导航2'
    #     link: 'https://www.163.com'
    #   }
    #   {
    #     name: '导航3'
    #     link: 'https://www.163.com'
    #   }
    #   {
    #     name: '导航4'
    #     link: 'https://www.163.com'
    #   }
    #   {
    #     name: '导航5'
    #     link: 'https://www.163.com'
    #   }

    # ]

    $scope.add = ->
      $scope.navs.push({name:"导航", link:"http://www.163.com"})
      return

    $scope.del = (index)->
      $scope.navs.splice(index, 1)
      return
    $scope.up = (index)->
      [$scope.navs[index - 1], $scope.navs[index]] = [$scope.navs[index], $scope.navs[index - 1]]
      return
    $scope.down = (index)->
      [$scope.navs[index], $scope.navs[index + 1]] = [$scope.navs[index + 1], $scope.navs[index]]
      return

    return